package org.dubbo.consumer2;

import com.alibaba.dubbo.demo.DemoService;
import com.alibaba.dubbo.demo.RcmdService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DemoServiceConsumer {
    public static void main(String[] args) {

        //测试常规服务
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("consumer.xml");
        context.start();
        System.out.println("consumer start");
        DemoService demoService = context.getBean(DemoService.class);
        while (true){
            System.out.println("----DemoServiceConsumer----");
            String sayName = demoService.sayName("zhangsan");
            System.out.println(sayName);
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
